package com.spsoft.vatoutinv.service.vmscreditlimit;

import com.baomidou.mybatisplus.extension.service.IService;
import com.spsoft.core.model.Result;
import com.spsoft.core.model.bo.TokenUser;
import com.spsoft.core.model.leqidmz.param.ApplyCreditParams;
import com.spsoft.core.model.leqidmz.param.BaseNsrRequestParams;
import com.spsoft.core.model.leqidmz.param.QueryCreditPeriodParams;
import com.spsoft.vatoutinv.entity.vmscreditlimit.VmsCreditLimit;
import com.spsoft.vatoutinv.enums.SxedUpdateEnum;
import com.spsoft.vatoutinv.model.vo.vmscreditlimit.VmsCreditlimitVO;

import java.math.BigDecimal;

/**
 * <p>
 * 授信额度信息表 服务类
 * </p>
 *
 * @author wangy
 * @since 2023-11-24
 */
public interface VmsCreditLimitService extends IService<VmsCreditLimit> {

    /**
     * 获取授信额度信息
     */
    Result<VmsCreditlimitVO> getCreditLimit();

    /**
     * 调用乐企接口获取授信额度信息
     */
    Result<Object> getCreditLimitByLq(BaseNsrRequestParams params, TokenUser tokenUser);

    /**
     * 调用乐企接口调整授信额度有效期
     */
    Result<Object> updateCreditLimitDateByLq(QueryCreditPeriodParams params, TokenUser tokenUser);

    /**
     * 调用乐企接口下载/退回授信额度
     */
    Result<Object> applyCreditLimitByLq(ApplyCreditParams params, TokenUser tokenUser);

    /**
     * 计算授信额度是否充足
     */
    VmsCreditLimit getSxedByDeptCode(String deptCode);

    /**
     * 消耗所需授信额度
     */
    Boolean updateSxed(String type, SxedUpdateEnum sxedUpdateEnum, BigDecimal jshjSum, VmsCreditLimit checkSxed, TokenUser tokenUser);
}
